;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10 -*-

;;; Load Autoclass Program and optional Results User Interface -- RELEASED

;;;--------------------------------------------------------------------------;;;
;;;  AUTOCLASS 3.0  Released 5/11/90    contact:  Taylor@pluto.arc.nasa.gov  ;;;
;;;  by P. Cheeseman, J. Stutz, R. Hanson, W. Taylor 			     ;;;
;;;  NASA Ames Research Center, MS 244-17, Moffett Field, CA 94035           ;;;
;;;                                                                          ;;;
;;;  Copyright (C) 1990 Research Institute for Advanced Computer Science.    ;;;
;;;  All rights reserved.  The RIACS Software Policy contains specific       ;;;
;;;  terms and conditions on the use of this software, and must be           ;;;
;;;  distributed with any copies.  THIS FILE MAY BE REDISTRIBUTED.  This     ;;;
;;;  copyright and notice must be preserved in all copies made of this file. ;;;
;;;--------------------------------------------------------------------------;;;
;;;	revised 5/18/90 for 3.0.1

(in-package 'user)

#+ (and (not :Lispm) (not :Coral))
(load (namestring
	(make-pathname :directory 
                       (append (pathname-directory 
				 (namestring *default-pathname-defaults*))
                               '("prog"))
		       :name "sys-dcl" :type "lisp")))

#+ (and (not :Lispm) :Coral)
(load (namestring
	(make-pathname :directory 
                       (namestring (make-pathname :name "prog" 
						  :defaults *default-pathname-defaults*))
                       :name "sys-dcl" :type "lisp")))


#+ :Lispm
(progn

  #+ :Symbolics
  (progn
    ;; NOTE: This load file loads two separate systems:
    ;;	AUTOCLASS, & AUTOCLASS-UI.

    (send *terminal-io* :set-more-p nil)		; turn off *MORE* processing
    (send *terminal-io* :set-deexposed-typeout-action :permit)	; allow Lisp Listener to typeout when de-exposed

    (defvar *user-interface-p* nil)

    (format *standard-output*
	    (concatenate 'string "~2% Options for seeing classification results:"
			 "~%	Report Generation Only: Attribute influence values &"
			 "~%		case vs. class cross-references."
			 "~%	Results User Interface: Bar graphs of attribute influence"
			 "~%		values, and specialized plots; in addition to report"
			 "~%		generation. ~2%"))

    (setf *user-interface-p* (y-or-n-p " Do you want the results user interface? "))

    (setf compiler:suppress-compiler-warnings t))

  #+ :Explorer
  (setq compiler:qc-file-check-indentation nil)

  (when (null (find-package 'autoclass))

    #+ :Symbolics
    (compile-system 'AUTOCLASS :no-warn t :query :no-confirm :increment-version nil)
    #+ :Explorer
    (make-system 'AUTOCLASS :nowarn :noconfirm :compile)
    )

  #+ :Symbolics
  (when (and *user-interface-p*
	     (or (null (find-package 'ac-ui))
		 (and (find-package 'ac-ui)
		      (not (find-symbol "*AUTOCLASS-DISPLAY-WINDOW*" (find-package 'ac-ui))))))

    (compile-system 'AUTOCLASS-UI :no-warn t :query :no-confirm :increment-version nil))

  #+ :Symbolics
  (setf compiler:suppress-compiler-warnings nil)
  )

#+ :Symbolics
(when *user-interface-p*
  (let ((superior (send *terminal-io* :superior)))
    (dw:find-program-window (intern "AUTOCLASS-DISPLAY-WINDOW" (find-package 'ac-ui))
			    :create-p :force :superior superior)))

(format *standard-output*
	(concatenate 'string "~2%WELCOME TO AUTOCLASS --"
		     "~2%Make sure you are in the correct package by using (in-package '"
		     #- :Explorer "ac" #+ :Explorer "autoclass" ")"
		     "~2%First you need data (your 'db2' file),"
		     "~%then you need to describe it (your 'hd2' & 'model' files),"
		     "~%then you can validity check these files with AUTOCLASS-INPUT-CHECK."
		     "~2%Next, find classification results with AUTOCLASS-SEARCH."
		     "~2%Finally, generate reports using AUTOCLASS-REPORTS-FROM-RESULTS-FILE"
		     "~%or AUTOCLASS-REPORTS-FROM-CLSF."))

#+ :Symbolics
(if *user-interface-p*
    (format *standard-output*
	    (concatenate 'string
			 "~2%The Results User Interface is available for generating reports,"
			 "~%bar-charts, and specialized plots -- <SELECT>-@ ~2%")))


